<template>
  <el-row :gutter="26" class="teacher-list" v-if="teacherList.length > 0">
    <el-col :span="6" v-for="(item, index) in teacherList" :key="index">
      <el-row type="flex" align="middle" class="item">
        <edu-avatar
          :src="item.avatar_url"
          :size="120"
          @click="handleAdvance(item.user_id)"
        ></edu-avatar>
        <div class="name" @click="handleAdvance(item.user_id)">{{ item.title }}</div>
        <template v-if="item.level_id">
          <div class="btn copper" v-if="item.level_id">{{ item.level_text }}</div>
          <!-- <div class="btn silver" v-else-if="item.level_id == 2">{{item.level_text}}</div>
          <div class="btn gold" v-else-if="item.level_id == 3">{{item.level_text}}</div> -->
        </template>
        <div class="desc">{{ item.signature }}</div>
      </el-row>
    </el-col>
  </el-row>
</template>

<script>
export default {
  props: {
    teacherList: {
      type: Array
    },
    level: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    handleAdvance(id) {
      this.$emit('next', id)
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/styles/hover.scss';
.teacher-list {
  .item {
    height: 290px;
    border-radius: 4px;
    flex-direction: column;
    padding: 30px;
    margin-bottom: 30px;
    background-color: #fff;
    @include prefixed(transition-duration, 0.3s);
    &:hover {
      box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.3);
      transform: translateY(-5px);
    }
    .name {
      margin-top: 15px;
      color: $text-color-import;
      font-size: 15px;
      cursor: pointer;
      max-width: 220px;
      @include ellipsis();
    }
    .btn {
      margin-top: 6px;
      font-size: 12px;
      border-width: 1px;
      border-style: solid;
      padding: 2.5px 5px;
      &.gold {
        color: #f54030;
        border-color: #f54030;
      }
      &.silver {
        color: #ff8a52;
        border-color: #ff8a52;
      }
      &.copper {
        color: #909399;
        border-color: #909399;
      }
    }
    .desc {
      margin-top: 15px;
      color: $text-color-auxiliary;
      font-size: 12px;
      line-height: 19px;
      text-align: center;
      max-width: 200px;
      @include ellipsis;
    }
  }
}
</style>
